package stream第二遍.demo08;

import java.util.Arrays;
import java.util.Optional;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/6 12:40
 */

public class Test {
    public static void main(String[] args) {
        Integer [] arr={1,2,3,4,56,67,7};
        Optional<Integer> reduce = Arrays.stream(arr).reduce((o1, o2) -> o1 += o2);
        System.out.println("reduce = " + reduce);
    }
}
